package com.young.core.dao.impl;

import com.young.core.dao.BaseDao;
import com.young.core.dao.EventDao;
import com.young.core.domain.EventDO;
import org.springframework.stereotype.Component;

import java.util.Collection;

@Component
public class EventDaoImpl extends BaseDao implements EventDao {

    @Override
    public void insert(EventDO event) {
        this.sqlSession.insert("EventMapper.insert", event);
    }

    @Override
    public int delete(int id) {
        return this.sqlSession.delete("EventMapper.delete", id);
    }

    @Override
    public Collection<EventDO> fetch(int size) {
        return this.sqlSession.selectList("EventMapper.fetch",size);
    }

}
